package com.android.tea.data;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

/**
 * sharepreference文件处理
 * 
 * @author start
 * 
 */
public class SettingLoader {

	private static final String INIT_CONFIG = "config";
	private static final String TEAFRIEND_TAB = "teafriend_tab";

	public static int getFriendTabIndex(Context context) {
		SharedPreferences sharedPreferences = context.getSharedPreferences(INIT_CONFIG, Context.MODE_PRIVATE);
		return sharedPreferences.getInt(TEAFRIEND_TAB, 0);
	}

	public static void setFriendTabIndex(Context context, int tabIndex) {
		SharedPreferences sharedPreferences = context.getSharedPreferences(INIT_CONFIG, Context.MODE_PRIVATE);
		Editor edit = sharedPreferences.edit();
		edit.putInt(TEAFRIEND_TAB, tabIndex);
		edit.commit();
	}

}
